#ifndef QYAM3DVIEW_H
#define QYAM3DVIEW_H


#include <QGLWidget>
#include <QTime>
#include <QTimer>
#include <yam3dscene.h>

typedef yam3d::Yam3DScene*(*SceneCreateFuncType)();

class QYam3DView : public QGLWidget
{
    Q_OBJECT
public:
    explicit QYam3DView(QWidget *parent = 0);
    ~QYam3DView();

    void setSceneCreateFunc(SceneCreateFuncType pfCreateScene);
    QSize minimumSizeHint() const;
    QSize sizeHint() const;

    yam3d::Yam3DScene* getScene() const
    {
        return m_scene;
    }

protected:
    void initializeGL();
    void paintGL();
    void resizeGL(int width, int height);

signals:

public slots:
   void update();

private:
   void init();

   SceneCreateFuncType m_pfCreateScene;
   yam3d::Yam3DScene*  m_scene;
   bool                m_initRequested;
   QTimer m_timer;

};

#endif // QYAM3DVIEW_H
